package com.woniuxy.user.configuration;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 吴毛伟
 * @date:2020/7/20 10:19
 * @description:
 */
@Configuration
public class RestTemplateConfiguration {
    @Bean
    @LoadBalanced  //开启负载均衡  因为微服务项目默认就是集群项目，每一个微服务都是一个集群
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
